import { PureComponent } from 'react';
import './index.less'
import { Swiper } from 'react-vant';
import Lazyimg from 'react-lazyimg-component';
import loadingpng from '@/assets/loading.png';
class Like extends PureComponent {
    render() {
        let { likeList } = this.props;
        return (
            <div className='like'>
                <div className='title'>
                    优品推荐
                </div>
                <div>
                    <Swiper>
                        {
                            likeList.map((item, index) => {
                                return (
                                    <Swiper.Item key={index}>
                                        <div className='likeGoodsList'>
                                            {
                                                item.map((goods) => {
                                                    return (
                                                        <div className='likeGoods' key={goods.id}>
                                                            <Lazyimg className="lazy" src={goods.image} placeholder={<img src={loadingpng} alt='加载失败' />} />
                                                            <div className='likename'>
                                                                {goods.storeName}
                                                            </div>
                                                            <div className='likegoodsprice'>
                                                                ￥{goods.price}
                                                            </div>
                                                        </div>
                                                    )
                                                })
                                            }
                                        </div>
                                    </Swiper.Item>
                                )
                            })
                        }
                    </Swiper>
                </div>
            </div>
        )
    }
}
export default Like;